<!DOCTYPE html>
 <html class="no-focus" lang="en"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">

        <title>OneUI - Admin Dashboard Template &amp; UI Framework</title>

        <meta name="description" content="OneUI - Admin Dashboard Template &amp; UI Framework created by pixelcave and published on Themeforest">
        <meta name="author" content="pixelcave">
        <meta name="robots" content="noindex, nofollow">
        <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0">
        <link rel="shortcut icon" href="assets/img/favicons/favicon.png">

        <link rel="icon" type="image/png" href="assets/img/favicons/favicon-16x16.png" sizes="16x16">
        <link rel="icon" type="image/png" href="assets/img/favicons/favicon-32x32.png" sizes="32x32">
        <link rel="icon" type="image/png" href="assets/img/favicons/favicon-96x96.png" sizes="96x96">
        <link rel="icon" type="image/png" href="assets/img/favicons/favicon-160x160.png" sizes="160x160">
        <link rel="icon" type="image/png" href="assets/img/favicons/favicon-192x192.png" sizes="192x192">

        <link rel="apple-touch-icon" sizes="57x57" href="assets/img/favicons/apple-touch-icon-57x57.png">
        <link rel="apple-touch-icon" sizes="60x60" href="assets/img/favicons/apple-touch-icon-60x60.png">
        <link rel="apple-touch-icon" sizes="72x72" href="assets/img/favicons/apple-touch-icon-72x72.png">
        <link rel="apple-touch-icon" sizes="76x76" href="assets/img/favicons/apple-touch-icon-76x76.png">
        <link rel="apple-touch-icon" sizes="114x114" href="assets/img/favicons/apple-touch-icon-114x114.png">
        <link rel="apple-touch-icon" sizes="120x120" href="assets/img/favicons/apple-touch-icon-120x120.png">
        <link rel="apple-touch-icon" sizes="144x144" href="assets/img/favicons/apple-touch-icon-144x144.png">
        <link rel="apple-touch-icon" sizes="152x152" href="assets/img/favicons/apple-touch-icon-152x152.png">
        <link rel="apple-touch-icon" sizes="180x180" href="assets/img/favicons/apple-touch-icon-180x180.png">
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400italic,600,700%7COpen+Sans:300,400,400italic,600,700">

        <!-- Bootstrap and OneUI CSS framework -->
        <link rel="stylesheet" href="assets/css/bootstrap.min.css">
        <link rel="stylesheet" id="css-main" href="assets/css/oneui.css">       
    </head>
    <body>      
        <div id="page-container" class="sidebar-l sidebar-o side-scroll header-navbar-fixed">
        
            <!-- Sidebar -->
            <nav id="sidebar">
                <!-- Sidebar Scroll Container -->
                <div id="sidebar-scroll">
                    <!-- Sidebar Content -->
                    <!-- Adding .sidebar-mini-hide to an element will hide it when the sidebar is in mini mode -->
                    <div class="sidebar-content">
                        <!-- Side Header -->
                        <div class="side-header side-content bg-white-op">
                            <!-- Layout API, functionality initialized in App() -> uiLayoutApi() -->
                            <button class="btn btn-link text-gray pull-right hidden-md hidden-lg" type="button" data-toggle="layout" data-action="sidebar_close">
                                <i class="fa fa-times"></i>
                            </button>                       
                            <a class="h5 text-white" href="main.html">
                                <i class="fa fa-circle-o-notch text-primary"></i> <span class="h4 font-w600 sidebar-mini-hide">me</span>
                            </a>
                        </div>
                        <!-- END Side Header -->

                        <!-- Side Content -->
                         <div class="side-content side-content-full">
                            <ul class="nav-main">                                
                                <li class="nav-main-heading"><span class="sidebar-mini-hide">目录</span></li>
                                <li>
                                    <a class="" href="main.html"><i class="si si-cup"></i><span class="sidebar-mini-hide">首页</span></a>
                                </li>
                                <li>
                                    <a class="" href="allstudy.html"><i class="si si-book-open"></i><span class="sidebar-mini-hide">学习资源</span></a>
                                </li>
                                <li>
                                    <a class="" href="mystudy.html"><i class="si si-book-open"></i><span class="sidebar-mini-hide">我的学习</span></a>
                                </li>
                                <li class="open">
                                    <a class="nav-submenu" data-toggle="nav-submenu" href="#"><i class="si si-grid"></i><span class="sidebar-mini-hide">管理</span></a>
                                    <ul>
                                        <li>
                                            <a class="" href="videomanage.html">视频资源</a>
                                        </li>
                                        <li>
                                            <a class="" href="docmanage.html">文档资源</a>
                                        </li>
                                        <li>
                                            <a class="" href="learnermanage.html">学习者管理</a>
                                        </li>
                                        <li>
                                            <a class="" href="newsource.html">资源上传</a>
                                        </li>
                                        <li>
                                            <a class="" href="audit.html">资源审核</a>
                                        </li>
                                    </ul>
                                </li>
                                <li class="open">
                                    <a class="nav-submenu" data-toggle="nav-submenu" href="#"><i class="si si-user"></i><span class="sidebar-mini-hide">个人中心</span></a>
                                    <ul>
                                        <li>
                                            <a class="active" href="myself.html">个人信息</a>
                                        </li>
                                        <li>
                                            <a class="" href="mypassword.html">修改密码</a>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </div>
                        <!-- END Side Content -->
                    </div>
                    <!-- Sidebar Content -->
                </div>
                <!-- END Sidebar Scroll Container -->
            </nav>
            <!-- END Sidebar -->
            
             <!-- Header -->
            <header id="header-navbar" class="content-mini content-mini-full">                            
                <!-- Header Navigation Left -->
                <ul class="nav-header pull-left">
                    <li class="hidden-md hidden-lg">
                        <!-- Layout API, functionality initialized in App() -> uiLayoutApi() -->
                        <button class="btn btn-default" data-toggle="layout" data-action="sidebar_toggle" type="button">
                            <i class="fa fa-navicon"></i>
                        </button>
                    </li>
                    <li class="hidden-xs hidden-sm">
                        <!-- Layout API, functionality initialized in App() -> uiLayoutApi() -->
                        <button class="btn btn-default" data-toggle="layout" data-action="sidebar_mini_toggle" type="button">
                            <i class="fa fa-ellipsis-v"></i>
                        </button>
                    </li>                                                          
                </ul>
            </header>

            <!-- Main Container -->
            <main id="main-container">
                <!-- Page Content -->
                <div class="content content-boxed">

                    <!-- Customer Info -->
                    <div class="block">
                        <!-- Basic Info -->
                        <div class="block-content text-center overflow-hidden">
                            <div class="push-30-t push animated fadeInDown">
                                <img class="img-avatar" src="assets/img/avatars/avatar10.jpg" alt="">
                            </div>
                            <div class="push-30 animated fadeInUp">
                                <h2 class="h4 font-w600 push-5" id="name">
                                    <i class="fa fa-star text-warning" data-toggle="tooltip" title="Premium Member"></i>
                                </h2>
                                <h3 class="h5 text-muted" id="role"></h3>
                            </div>
                        </div>
                        <!-- END Basic Info -->                        
                    </div>
                    <!-- END Customer Info -->

                    <!-- Addresses -->
                    <div class="block">
                        <div class="block-header bg-gray-lighter">
                            <h3 class="block-title">个人信息</h3>
                        </div>
                        <div class="block-content">
                            <div class="row">
                                <div class="col-lg-12">
                                    <form class="js-validation-bootstrap form-horizontal" action="base_forms_validation.html" method="post" novalidate="novalidate">
                                        <div class="form-group">
                                            <label class="col-md-4 control-label" for="val-username">姓名 <span class="text-danger">*</span></label>
                                            <div class="col-md-5">
                                                <input class="form-control" id="val-username" disabled>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-4 control-label" for="sex">性别 <span class="text-danger">*</span></label>
                                            <div class="col-md-5">
                                                <input class="form-control" id="sex" disabled>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-4 control-label" for="phone">手机号 <span class="text-danger">*</span></label>
                                            <div class="col-md-5">
                                                <input class="form-control" id="phone" disabled>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-md-4 control-label" for="userid">身份证号 <span class="text-danger">*</span></label>
                                            <div class="col-md-5">
                                                <input class="form-control" id="userid" disabled>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="row" id="xx">
                        <div class="col-sm-3">
                        </div>
                        <div class="col-sm-6">
                            <a class="block block-link-hover3 text-center" id="xxs">
                                <div class="block-content block-content-full">
                                    <div class="h1 font-w700"><i class="fa fa-pencil"></i></div>
                                </div>
                                <div class="block-content block-content-full block-content-mini bg-gray-lighter text-muted font-w600">编辑</div>
                            </a>
                        </div>
                    </div>

                    <div class="row" style="display: none" id="ss">
                        <div class="col-sm-6">
                            <a class="block block-link-hover3 text-center" id="save">
                                <div class="block-content block-content-full">
                                    <div class="h1 font-w700"><i class="fa fa-pencil"></i></div>
                                </div>
                                <div class="block-content block-content-full block-content-mini bg-gray-lighter text-muted font-w600">保存</div>
                            </a>
                        </div>
                        <div class="col-sm-6">
                            <a class="block block-link-hover3 text-center" id="quit">
                                <div class="block-content block-content-full">
                                    <div class="h1 font-w700"><i class="fa fa-pencil"></i></div>
                                </div>
                                <div class="block-content block-content-full block-content-mini bg-gray-lighter text-muted font-w600">取消</div>
                            </a>
                        </div>
                    </div>
                </div>
            </main>
        </div>

        <!-- OneUI Core JS: jQuery, Bootstrap, slimScroll, scrollLock, Appear, CountTo, Placeholder, Cookie and App.js -->
        <script src="assets/js/core/jquery.min.js"></script>
        <script src="assets/js/core/bootstrap.min.js"></script>
        <script src="assets/js/core/jquery.slimscroll.min.js"></script>
        <script src="assets/js/core/jquery.scrollLock.min.js"></script>
        <script src="assets/js/core/jquery.appear.min.js"></script>
        <script src="assets/js/core/jquery.countTo.min.js"></script>
        <script src="assets/js/core/jquery.placeholder.min.js"></script>
        <script src="assets/js/core/js.cookie.min.js"></script>
        <script src="assets/js/app.js"></script>
        <script src="js/contextPath.js"></script>
        <script src="layer/layer.js"></script>

        <!-- Page JS Code -->
        <script>
            $(document).ready(function () {
                $.ajax({
                    url: contextPath + "learner/personal",
                    contentType: "application/json; charset=utf-8",
                    type: "GET",
                    dataType: "json",
                    success: function (data) {
                        $('#name').text(data.name);
                        $('#role').text(data.role);
                        $('#val-username').val(data.name);
                        $('#sex').val(data.sex);
                        $('#phone').val(data.phone);
                        $('#userid').val(data.userid);
                    }
                });
            });
            $('#xxs').on('click', function () {
                $('#xx').hide();
                $('#ss').show();
                $('#val-username').attr("disabled", false);
                $('#sex').attr("disabled", false);
                $('#userid').attr("disabled", false);
            });
            $('#quit').on('click', function () {
                window.location.reload();
//                $('#xx').show();
//                $('#ss').hide();
//                $('#val-username').attr("disabled", true);
//                $('#sex').attr("disabled", true);
//                $('#userid').attr("disabled", true);
            });
            $('#save').on('click', function (){
                var jsons={};
                jsons.name = $('#val-username').val();
                jsons.sex = $('#sex').val();
                jsons.userid = $('#userid').val();
                $.ajax({
                    url: contextPath+"learner/update",
                    contentType : "application/json; charset=utf-8",
                    type: "PUT",
                    dataType: "json",
                    data:JSON.stringify(jsons),
                    success: function(data) {
                        if(data.message === "修改成功!"){
                            layer.msg('修改成功!<br>请重新登录...', {
                                time: 1000 //1s后自动关闭
                            });
                            $.ajax({
                                url: contextPath+"logoutUser",
                                contentType : "application/json; charset=utf-8",
                                type: "POST",
                                success: function(data){}
                            })
                        }else {
                            layer.msg(data.message, {
                                time:false,
                                btn:"确定",
                                btnAlign: 'c'
                            });
                        }
                    }
                });
            });
            jQuery(function () {
                // Init page helpers (Appear + CountTo plugins)
                App.initHelpers(['appear', 'appear-countTo']);
            });
        </script>
    </body>
</html>